#pragma once
//============================================================================
// Copyright (C) 2003-2012 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================

#pragma pack(push) 
#pragma pack(1)
class RcSysPktRelayServiceReq : public RcSysPktHdr
{
public:
	//=== vars ===//
	S64				m_s64LclInstance;

	//=== constructor ===//
	RcSysPktRelayServiceReq()
		: m_s64LclInstance(0)
	{
		m_u16PktLen		= sizeof(RcSysPktRelayServiceReq);		
		m_u16PktType	= RC_SYS_PKT_TYPE_PROXY_SERVICE_REQ; 
		vx_assert( 0 == ( m_u16PktLen & 0x0f ) );
	};
	void			setLclInstance( void * pInstance )					{ m_s64LclInstance = (U64)pInstance; }
	void *			getLclInstance( void )								{ return (void *)m_s64LclInstance; }
};

class RcSysPktRelayServiceReply : public RcSysPktHdr
{
public:
	//=== vars ===//
	U8				m_u8RelayStatus;
	U8				m_u8AccessState;
	U16				m_u16Res;
	U32				m_u32Error;
	S64				m_s64LclInstance;
	S64				m_s64RmtInstance;

	//=== constructor ===//
	RcSysPktRelayServiceReply()
		: m_u8RelayStatus(0)
		, m_u8AccessState(0)
		, m_u16Res(0)
		, m_u32Error(0)
		, m_s64LclInstance(0)
		, m_s64RmtInstance(0)
	{
		m_u16PktLen		= sizeof(RcSysPktRelayServiceReply);		
		m_u16PktType	= RC_SYS_PKT_TYPE_PROXY_SERVICE_REPLY; 
		vx_assert( 0 == ( m_u16PktLen & 0x0f ) );
	};
	void			setLclInstance( void * pInstance )					{ m_s64LclInstance = (U64)pInstance; }
	void *			getLclInstance( void )								{ return (void *)m_s64LclInstance; }
	void			setRmtInstance( void * pInstance )					{ m_s64RmtInstance = (U64)pInstance; }
	void *			getRmtInstance( void )								{ return (void *)m_s64RmtInstance; }
	void			setAccessState( EPluginAccessState ePluginAccess )  { m_u32Error = (U32)ePluginAccess; }
	EPluginAccessState getAccessState( void )							{ return (EPluginAccessState)m_u32Error; }
	void			setRelayStatus( ERelayStatus eStatus )				{ m_u8RelayStatus = (U8)eStatus; }
	ERelayStatus	getRelayStatus( void )								{ return (ERelayStatus)m_u8RelayStatus; }


};

#pragma pack(pop)
